package com.ulic.customerManApplication.mailmodule.service.impl;

import javax.annotation.Resource;

import org.springframework.stereotype.Component;

import com.ulic.customerManApplication.commonmodule.bo.BirthdayMessage;
import com.ulic.customerManApplication.commonmodule.bo.MailSignature;
import com.ulic.customerManApplication.mailmodule.bo.MailRecord;
import com.ulic.customerManApplication.mailmodule.dao.MailDao;
import com.ulic.customerManApplication.mailmodule.service.MailService;
import com.ulic.customerManApplication.mailmodule.vo.MailRecordVO;
import com.ulic.customerManApplication.pager.PagerModel;
import com.ulic.customerManApplication.usermodule.bo.User;

@Component("mailService")
public class MailServiceImpl implements MailService {

	private MailDao mailDao;
	
	@Resource
	public void setMailDao(MailDao mailDao) {
		this.mailDao = mailDao;
	}
	public MailDao getMailDao() {
		return mailDao;
	}

	@Override
	public void addBirthdayBless(BirthdayMessage birthdayMessage) {
		// TODO Auto-generated method stub
    
		mailDao.insertBirthdayBless(birthdayMessage);
	}

	@Override
	public void addMailRecords(MailRecord mailRecord) {
		// TODO Auto-generated method stub

		mailDao.insertMailRecords(mailRecord);
	}

	@Override
	public MailRecord getMailRecordById(int id) {
		// TODO Auto-generated method stub
		return mailDao.getMailRecordById(id);
	}

	@Override
	public PagerModel getMailRecords(int curPage) {
		// TODO Auto-generated method stub
		return mailDao.getMailRecords(curPage);
	}

	@Override
	public PagerModel getMailRecords(MailRecordVO mailRecordVO, int curPage) {
		// TODO Auto-generated method stub
		return mailDao.getMailRecords(mailRecordVO, curPage);
	}

	@Override
	public void removeMailRecord(MailRecord mailRecord) {
		// TODO Auto-generated method stub

		mailDao.deleteMailRecord(mailRecord);
	}
	@Override
	public BirthdayMessage getBirthdayMessageByType(User user,String type) {
		return mailDao.getBirthdayMessageByType(user,type);
	}
	@Override
	public MailSignature getMailSignature(User user) {
		return mailDao.getMailSignature(user);
	}
	@Override
	public void saveMailSignature(MailSignature mailSignature) {
		mailDao.saveMailSignature(mailSignature);
	}

}
